//
//  RegisteredViewController.m
//  QQ界面
//
//  Created by apple on 16/10/26.
//  Copyright © 2016年 LWB. All rights reserved.
//

#import "RegisteredViewController.h"
#import "LoginViewController.h"
@interface RegisteredViewController ()

@end

@implementation RegisteredViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    UILabel *loginLabel = [[UILabel alloc]initWithFrame:CGRectMake(85,90,180, 40)];
    loginLabel.text = @"QQ注册界面";
    loginLabel.backgroundColor = [UIColor brownColor];
    loginLabel.textAlignment = NSTextAlignmentCenter;
    loginLabel.font =[UIFont systemFontOfSize:30];
    [self.view addSubview:loginLabel];
    //创建帐号标签
    UILabel *countLabel = [[UILabel alloc]initWithFrame:CGRectMake(70,170,50,30)];
    countLabel.text = @"帐号:";
    countLabel.font = [UIFont systemFontOfSize:22];
    [self.view addSubview:countLabel];
    
    //创建密码标签
    UILabel *pwdLabel = [[UILabel alloc]initWithFrame:CGRectMake(70,220,50,30)];
    pwdLabel.text = @"密码:";
    pwdLabel.font = [UIFont systemFontOfSize:22];
    [self.view addSubview:pwdLabel];
    
    //创建确认密码标签
    UILabel *pwdLabel1 = [[UILabel alloc]initWithFrame:CGRectMake(28,270,100,30)];
    pwdLabel1.text = @"确认密码:";
    pwdLabel1.font = [UIFont systemFontOfSize:22];
    [self.view addSubview:pwdLabel1];
    
    //创建帐号输入框
    UITextField *countField = [[UITextField alloc]initWithFrame:CGRectMake(125, 170, 130, 30)];
    countField.placeholder =@"请输入帐号";
    countField.borderStyle = UITextBorderStyleRoundedRect;
    countField.clearButtonMode =UITextFieldViewModeAlways;
    [self.view addSubview:countField];
    //创建密码输入框
    UITextField *pwdField = [[UITextField alloc]initWithFrame:CGRectMake(125, 220, 130, 30)];
    pwdField.placeholder =@"请输入密码";
    pwdField.borderStyle = UITextBorderStyleRoundedRect;
    pwdField.secureTextEntry =YES;
    pwdField.clearButtonMode =UITextFieldViewModeAlways;
    [self.view addSubview:pwdField];
    //创建确认密码输入框
    UITextField *pwdField1 = [[UITextField alloc]initWithFrame:CGRectMake(128, 270, 130, 30)];
    pwdField1.placeholder =@"请输入密码";
    pwdField1.borderStyle = UITextBorderStyleRoundedRect;
    pwdField1.secureTextEntry =YES;
    pwdField1.clearButtonMode =UITextFieldViewModeAlways;
    [self.view addSubview:pwdField1];
    //创建注册按钮
    UIButton *registeredBut = [[UIButton alloc]initWithFrame:CGRectMake(140, 365, 50, 30)];
    registeredBut.backgroundColor = [UIColor blueColor];
    [registeredBut setTitle:@"注册" forState:UIControlStateNormal];
    [registeredBut setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    [registeredBut addTarget:self action:@selector(registeredAction) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:registeredBut];
    
    // Do any additional setup after loading the view.
}
-(void)jumpPageController{
       [self.navigationController popViewControllerAnimated:YES];
}
-(void)registeredAction{
    UIAlertController * alert = [UIAlertController alertControllerWithTitle:@"注册成功" message:@"" preferredStyle:UIAlertControllerStyleAlert];
    [alert addAction:[UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
         NSTimer  *timer = [NSTimer scheduledTimerWithTimeInterval:0.2 target:self selector:@selector(jumpPageController) userInfo:nil repeats:YES];
        
    }]];
    [self presentViewController:alert animated:YES completion:nil];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
